package com.cqgc.mapper;

import com.cqgc.pojo.dto.DeliveryDTO.DeleteDeliveryDTO;
import com.cqgc.pojo.dto.DeliveryDTO.DeliveryLikeDTO;
import com.cqgc.pojo.dto.DeliveryDTO.DeliveryPageDTO;
import com.cqgc.pojo.dto.DeliveryDTO.UpdateDeliveryStatusDTO;
import com.cqgc.pojo.entity.Delivery;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author : 是你
 * @time : 2024/4/24 16:28
 */
@Mapper
public interface DeliveryMapper {
//    @Insert("insert into delivery(delivery_account,delivery_phone,order_number) values (#{deliveryAccount},#{deliveryPhone},#{orderNumber})")
    public int add(Delivery delivery);

    int count(String acount);

    List<Delivery> list(String deliveryAccount);

    int update(Delivery delivery);

    int delete(DeleteDeliveryDTO id);

//    @Select("select * from deliver")
    List<Delivery> listAll();

    Delivery findById(int id);

    int updateStatus(UpdateDeliveryStatusDTO updateDeliveryStatusDTO);

    @Select("select * from delivery where delivery_account = #{deliveryAccount}")
    Page<Delivery> page(DeliveryPageDTO deliveryPageDTO,String deliveryAccount);
    @Select("select * from delivery")
    Page<Delivery> pageAll(DeliveryPageDTO deliveryPageDTO);

    Page<Delivery> like(DeliveryLikeDTO deliveryLikeDTO);
}
